<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>计划详情</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
            vertical-align: middle;
            padding: 0;
            height: 24px;
            line-height: 100%;

        }

        table .td-title {
            background-color: #f8f8f8;
            line-height: 24px;
            font-weight: bold;
        }

        table .td-title2 {
            line-height: 24px;
            font-weight: bold;
        }

        table .td-module {
            background: yellow !important;
            line-height: 24px;
            font-weight: bold;
        }

        .table > tbody > tr > td.td-row2 {
            height: 56px;
            line-height: 20px;
            max-height: 56px;
            overflow: hidden;
        }

        .table > tbody > tr > td.td-row2 span {
            max-height: 44px;
            line-height: 22px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        .table > tbody > tr > td.td-row3 {
            height: 56px;
            line-height: 18px;
            max-height: 56px;
            overflow: hidden;
        }

        .table > tbody > tr > td.td-row3 span {
            max-height: 56px;
            line-height: 18px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
        }

        .td-value span.lineOne {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .td-value1 span.lineOne {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        input[type=text], input[type=tel], input[type=number], select {
            box-sizing: border-box;
            border-width: 0px;
            border-style: none;
            padding-right: 0px !important;
            padding-top: 0px !important;
            padding-bottom: 0px !important;
            margin-left: 0px !important;
            margin-right: 0px !important;
            margin-top: 0px !important;
            margin-bottom: 0px !important;
            padding-left: 6px;
        }

        input[type=text], input[type=tel], input[type=number], select {
            height: 24px;
            width: 100%;
            border: none;
            outline: none;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .table .td-value span, .table .td-value input[type="text"], .td-value {
            vertical-align: middle;
            word-wrap: break-word;
            color: #2a8cec !important;
        }

        .tableTomorrow input, .tableTomorrow td {
            background: #fafafa;
        }
        .table-no-border-left {
            border-left-width: 0px !important;
        }

        .table-width-auto {
            width: 33.5% !important;
        }

        .table-bottom-width {
            border-bottom-width: 0px !important;
        }
        .lineOne {
            text-align: center;
        }
        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }
    </style>
</head>
<body>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
        <table class="table text-center table-hover">
            <thead>
            <tr>
                <th style="width:100px">拜访日期</th>
                <th style="width:100px">拜访目的</th>
                <th style="width:100px">客户姓名</th>
                <th style="width:100px">陪同人员</th>
                <th >地点</th>
            </tr>
            </thead>
            <tbody>
            <tr v-for="(item,i) in list">
                <td :rowspan="item.reportDatespan" :class="{hidden: item.reportDatedis}" style="border-right: 1px solid #cbcbcd">
                    {{item.reportDate?item.reportDate:"-"}}
                </td>
                <td>{{item.visitGoal}}</td>
                <td>{{item.customerName}}</td>
                <td>{{item.entourage}}</td>
                <td><span class="lineOne">{{item.customerAddress}}</span></td>
            </tr>
            </tbody>
        </table>
    </div>

    <!-- /.box-body -->
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=602456c3"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=666bff22"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            userId: $.wyui.page.urlParams.userId,
            dateTime:$.wyui.page.urlParams.dateTime,
            list:[]
        },
        methods: {
            //合并单元格
            tablesMergeCell: function (list) {
                if (list != undefined && list && list.length > 0) {
                    for (field in list[0]) {
                        var k = 0;
                        while (k < list.length) {
                            list[k][field + 'span'] = 1;
                            list[k][field + 'dis'] = false;
                            for (var i = k + 1; i <= list.length - 1; i++) {
                                if (list[k][field] == list[i][field] && list[k][field] != '') {
                                    list[k][field + 'span']++;
                                    list[k][field + 'dis'] = false;
                                    list[i][field + 'span'] = 1;
                                    list[i][field + 'dis'] = true;
                                } else {
                                    break;
                                }
                            }
                            k = i;
                        }
                    }
                }
                return list;
            },
        },
        mounted: function () {
            var that = this;
            $.wyui.postMethod(urlConfig.report.visitCustomer.getBigRegionManagerPlanVisit, {
                "userId": that.userId,
                "dateTime": that.dateTime,
                "visitType": '1',
            }, function (data) {
                console.log(data)
                that.list=that.tablesMergeCell(data);
            }, true);
        }
    });
</script>
</body>
</html>